package com.ruoyi.alarmmanagement.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseDO;
import lombok.*;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 告警对象 t_warn
 *
 * @author ruoyi
 * @date 2023-09-06
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("t_warn")
public class DmWarn extends BaseDO {
    private static final long serialVersionUID = 1L;

    /**
     * 平台自增主键
     */
    @TableId
    private Long id;

    /**
     * 租户ID
     */
    @Excel(name = "租户ID")
    @TableField("tenant_id")
    private String tenantId;

    /**
     * 报警对象类型，对应自定义字典表WarnTargetType
     */
    @Excel(name = "报警对象类型", dictType = "warn_target_type")
    @TableField("target_type")
    private Integer targetType;

    /**
     * 报警对象ID
     */
    @Excel(name = "报警对象ID")
    @TableField("target_id")
    private String targetId;

    /**
     * 报警状态，0未确认，1已确认
     */
    @Excel(name = "报警状态", readConverterExp = "0=未确认,1=已确认")
    @TableField("warn_status")
    private Integer warnStatus;

    /**
     * 处理状态，0未处理，1已处理
     */
    @Excel(name = "处理状态", readConverterExp = "0=未处理,1=已处理")
    @TableField("handle_status")
    private Integer handleStatus;

    /**
     * 报警参数，对应自定义字典表WarnParamType
     */
    @Excel(name = "报警参数，对应自定义字典表WarnParamType", dictType = "warn_param_type")
    @TableField("warn_param_type")
    private Integer warnParamType;

    /**
     * 报警类型，1超上限，2超下限，3阈值，4累计，5连续
     */
    @Excel(name = "报警类型", dictType = "warn_type")
    @TableField("warn_type")
    private Integer warnType;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("start_time")
    private Date startTime;

    /**
     * 最近报警时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最近报警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("recently_warn_time")
    private Date recentlyWarnTime;

    /**
     * 数据冻结时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "数据冻结时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("freeze_time")
    private String freezeTime;

    /**
     * 报警值-实际数值
     */
    @Excel(name = "报警值-实际数值")
    @TableField("warn_value")
    private BigDecimal warnValue;

    /**
     * 参考值-超上限则上限值，超下限则下限值
     */
    @Excel(name = "参考值-超上限则上限值，超下限则下限值")
    @TableField("reference_value")
    private BigDecimal referenceValue;

    /**
     * 差值
     */
    @Excel(name = "差值")
    @TableField("value")
    private BigDecimal value;

    /**
     * 确认人
     */
    @Excel(name = "确认人")
    @TableField("confirmed_by")
    private String confirmedBy;

    /**
     * 派单状态
     */
    @Excel(name = "派单状态")
    @TableField("pd")
    private String pd;

    @TableField("terminal_type")
    private Short terminalType;

    @TableField(exist = false)
    private String terminalId;

    @TableField("description")
    private String description;

    @TableField("create_time")
    private Date createTime;

    @TableField(exist = false)
    private String beginStartTime;

    @TableField(exist = false)
    private String endStartTime;

    @TableField(exist = false)
    private String sheetsCode;

    @TableField(exist = false)
    private Long sysUserId;
    @TableField(exist = false)
    private String warnParamName;
}
